<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_log', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('uid')->index()->comment('用户id');
            $table->unsignedTinyInteger('type')->default(0)->comment('0:快递员  1:用户  2:共派管理员 3:服务站管理员 4网点管理员');
            $table->unsignedInteger('service_id')->index()->comment('服务站ID');
            $table->string('name')->comment('姓名');
            $table->string('operation')->comment('操作');
            $table->string('history',1000)->nullable()->comment('操作前状况');
            $table->string('actuality',1000)->nullable()->comment('操作后现状');
            $table->unsignedInteger('order_id')->default(0)->comment('订单id   没有订单则为0');
            $table->string('ip')->nullable()->comment('登录ip');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_log');
    }
}
